package com.fenqing.leetcode.code.t1400_1500;

import com.fenqing.annotations.Execute;
import com.fenqing.core.Topic;

import java.util.Arrays;

/**
 * @author fenqing
 */
public class Topic1470 extends Topic {

    /**
     * 构造器
     *
     * @param input1 输入
     * @param input2 输入
     */
    public Topic1470(String input1, String input2) {
        super(input1, input2);
    }

    @Execute
    public int[] shuffle(int[] nums, int n) {
        int[] result = new int[nums.length];
        int index = 0;
        for (int i = 0, j = n; i < n; i++, j++) {
            result[index++] = nums[i];
            result[index++] = nums[j];
        }
        return result;
    }

    public static void main(String[] args) {
        int[] run = new Topic1470("[2,5,1,3,4,7]", "3").run();
        System.out.println(Arrays.toString(run));
    }

}
